package com.example.dynamicproxy;

import com.example.staticproxy.Hello;
import com.example.staticproxy.HelloImpl;

/**
 * Created by luhaoyuan on 2017/1/7.
 */
public class Main {


    public static void main(String[] args) {

        Hello hello = new HelloImpl();
        DynamicProxy dynamicProxy = new DynamicProxy(hello);

        Hello helloProxy = dynamicProxy.getProxy();
        helloProxy.say("Jack");
    }

    private void proxy() {
        // 动态代理
//        Hello helloProxy = (Hello) Proxy.newProxyInstance(
//                hello.getClass().getClassLoader(),
//                hello.getClass().getInterfaces(),
//                dynamicProxy
//        );

    }
}
